// 基于template/src/widgets/\{{appEntities}}/\{{ctrls@LISTEXPBAR}}-list-exp-bar/\{{ctrls@LISTEXPBAR}}-list-exp-bar-model.ts.hbs生成
import { IListExpBarModel } from "@/core";

//  获取部件模型
function getModel(): IListExpBarModel {
  return {
    name: "{{ctrl.name}}",
    caption: "{{ctrl.caption}}",
    codeName: "{{ctrl.codeName}}",
    cssName: "{{#if ctrl.psSysCss}}{{ctrl.psSysCss.cssName}}{{/if}}",
    controlType: "{{ctrl.controlType}}",
    showTitleBar: {{ctrl.showTitleBar}},
    title: "{{ctrl.title}}",
    entityCodeName: '{{ctrl.psAppDataEntity.codeName}}',      
    enableSearch: {{ctrl.enableSearch}},
    {{#if ctrl.titlePSLanguageRes}}
    lanResTag: "{{ctrl.titlePSLanguageRes.lanResTag}}"
    {{/if}}
{{#if ctrl.xDataControlName}}
    xDataCtrlName: '{{ctrl.xDataControlName}}',
{{/if}}
{{#ctrl.ctrls}}
  {{#eq controlType "LIST"}}
    {{#if psAppDataEntity}}
    xDataDeCodeName: '{{lowerCase psAppDataEntity.codeName}}',
    xDataDeName: '{{psAppDataEntity.psDEName}}',
    {{/if}}
    {{#if navPSDER}}
    navPSDer: 'n_{{lowerCase navPSDER.minorCodeName}}_eq',
    {{/if}}
    {{#if navPSAppView}}
    navViewName: '{{navPSAppView.codeName}}',
    {{/if}}
    {{#if psNavigateContexts}}
    navigateContext: {{> @macro/common/navparam.hbs appNavParams=psNavigateContexts}},
    {{/if}}
    {{#if psNavigateParams}}
    navigateParams: {{> @macro/common/navparam.hbs appNavParams=psNavigateParams}},
    {{/if}}
  {{/eq}}
{{/ctrl.ctrls}}
  }
}

//  部件模型
export const model = getModel();

{{#ctrl.ctrls}}
  {{#eq controlType 'TOOLBAR'}}
//  获取工具栏项
function getToolbarItems() {
  return [
  {{> @macro/widgets/toolbar/toolbar-item.hbs items=psDEToolbarItems view=ctrl toolbar=this}}
  ];
}

//  工具栏项
export const toolbarItems = getToolbarItems();
  {{/eq}}
{{/ctrl.ctrls}}